package com.zhouzidong.controller;

import com.alibaba.fastjson.JSON;
import com.zhouzidong.entity.po.OrderModifyBoughtGiftDtl;
import com.zhouzidong.service.OrderModifyBoughtGiftDtlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class Controller {

    @Autowired
    private OrderModifyBoughtGiftDtlService orderModifyBoughtGiftDtlService;

    @RequestMapping("/getById")
    public String getById(@RequestParam Integer id) {
        OrderModifyBoughtGiftDtl byId = orderModifyBoughtGiftDtlService.getById(id);
        return JSON.toJSONString(byId);
    }

    @RequestMapping("/helllo")
    public String a() {
        return "hello world";
    }

    @RequestMapping("/removeById")
    public String removeById(@RequestParam Integer id) {
        boolean byId = orderModifyBoughtGiftDtlService.removeById(id);
        return JSON.toJSONString(byId);
    }
}
